<template>
  <div class="tablist">
    <div class="tableft">
      <ul>
        <li @click="msg = 0" :class="{ active: msg === 0 }">家电 数码 手机</li>
        <li @click="msg = 1" :class="{ active: msg === 1 }">家电 数码 手机</li>
        <li @click="msg = 2" :class="{ active: msg === 2 }">家电 数码 手机</li>
        <li @click="msg = 3" :class="{ active: msg === 3 }">家电 数码 手机</li>
      </ul>
    </div>
    <div class="tabright">
      <ul>
        <li v-show="msg === 0">
          <p class="title">家电</p>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
        </li>
        <li v-show="msg === 1">
          <p class="title">女装</p>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
        </li>
        <li v-show="msg === 2">
          <p class="title">家具</p>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
          <div class="contents">
            <img
              src="http://s.weituibao.com/1583591077131/%E5%88%86%E7%B1%BB.png"
              alt=""
            />
            <p>生活电器</p>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      msg: 0
    }
  }
}
</script>

<style lang="less" scoped>
.tablist {
  width: 100%;
  display: flex;
  .tableft {
    width: 25%;
    ul {
      width: 100%;
      li {
        height: 1rem;
        width: 100%;
        text-align: center;
        line-height: 1rem;
        list-style: none;
        background: #f8f8f8;
        &.active {
          color: #1baec0;
          background: #fff;
        }
      }
    }
  }
  .tabright {
    width: 75%;
    height: 100%;
    ul {
      width: 100%;
      li {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        .title {
          font-size: 0.5rem;
          width: 100%;
        }
        .contents {
          width: 33%;
          text-align: center;
          img {
            width: 0.8rem;
            height: 0.8rem;
          }
          p {
            margin-top: 0.5rem;
          }
        }
      }
    }
  }
}
</style>
